import Vue from 'vue'
import Router from 'vue-router'
import GoodsList from '@/components/GoodsList'
import Hi from '@/components/hi'
import GoodsListImg from '@/components/GoodsListImg'
import GoodsListName from '@/components/GoodsListName'
import Title from '@/components/Title'
import Left from '@/components/Left'
import Right from '@/components/Right'
import Test from '@/views/Test'
import Content from '@/views/Content'
import Shouye from '@/views/Shouye'


Vue.use(Router) //全局使用 Router

export default new Router({
    mode:"history",
    routes:[
        {
            path:"/:userId(\[asd]+\)/:userName",
            name:Shouye,
            component:Shouye
        },
        {
            path:'/content',
            name:'content',
            component:Content,
            children:[
                {
                    path:"/",
                    name:"Hi",
                    component:Hi
                },
                {
                    path:"goodsList",
                    name:"GoodsList",
                    component:GoodsList,
                    children:[
                        {
                            path:"img",
                            name:"img-name",
                            component:GoodsListImg
                        },{
                            path:'name',
                            name:"name-name",
                            component:GoodsListName
                        }
                    ]
                }
            ]
        },{
            path:'/Hi',
            name:'Hi',
            component:Hi
        },{
            path:"/goodsList",
            name:"goodsList",
            component:GoodsList,
            children:[
                {
                    path:"img",
                    name:"img-name",
                    component:GoodsListImg
                },{
                    path:'name',
                    name:"name-name",
                    component:GoodsListName
                }
            ]
        },{
            path:'/test',
            name:'Test',
            component:Test,
            children:[
                {
                    path:'/',
                    name:"Title",
                    components:{
                        title:Title,
                        left:Left,
                        right:Right
                    }
                },
                {
                    path:'btn1',
                    name:"btn1",
                    components:{
                        title:Title,
                        left:Left,
                        right:Right
                    }
                },
                {
                    path:'btn3',
                    name:"btn3",
                    components:{
                        title:Title,
                        left:Right,
                        right:Left
                    }
                },
                {
                    path:'btn2',
                    name:"btn2",
                    components:{
                        title:Left,
                        left:Right,
                        right:Title
                    }
                }
            ]
        }
    ]
})